package com.qianbei.view.transport;

/**
 * Created by gaoml on 2018/1/21.
 */

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextWatcher;
import android.text.style.AbsoluteSizeSpan;
import android.util.TypedValue;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.qianbei.R;
import com.qianbei.common.adapter.CommonAdapter;
import com.qianbei.common.adapter.ViewHolder;
import com.qianbei.common.net.control.Constant;
import com.qianbei.common.util.ConstantValue;
import com.qianbei.common.view.TagSpan;

import java.util.List;


/**
 * 相关问题 adapter
 *
 * @author jiaowenzheng
 * <p>
 * Created by user on 16/6/22.
 */
public class RecorWeightAdapter extends CommonAdapter<TrasportBean.ArrayBean.CustomerAryBean.NeedWeightBean> {


    public RecorWeightAdapter(Context context, List<TrasportBean.ArrayBean.CustomerAryBean.NeedWeightBean> data, int itemLayoutId) {
        super(context, data, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder helper, final TrasportBean.ArrayBean.CustomerAryBean.NeedWeightBean item, int position) {

        helper.setText(R.id.record_key, item.getName());
        EditText t = helper.getView(R.id.record_value);
        if (position == mDatas.size() - 1) {
            t.setHint("请输入联单号");
        } else {
            t.setFilters(new InputFilter[]{new WeightInputFilter()});
            t.setHint("请输入重量(公斤)");
        }
        String value = item.getValue();
        if (value != null) {
            t.setText(value + "");
        }
        if (item.getHint() != null) {
            t.setHint(item.getHint());
        }


//        helper.setText(R.id.record_value,item.getName());
//        helper.setImageBitmapCircle(iv_icon,R.drawable.ic_launcher, Constant.URL+item.getFace());
//        helper.setText(R.id.tv_answer_user_name,item.getName());
//        helper.setText(R.id.tv_answer_post,item.getIdentity());
//        helper.setText(R.id.tv_look_count, mResources.getString(R.string.item_question_format,
//                item.getUser_name(),item.getAnswer_price(),item.getSee_count()));
////        helper.setText(R.id.tv_yes_zan,mResources.getString(R.string.look_count_point_format,item.getSee_count()));
//        helper.setVisibility(R.id.tv_yes_zan,View.GONE);
//
//        final TextView stateTv = helper.getView(R.id.tv_question_state);
//        stateTv.setText(item.getStatus_text());


//        helper.getView(R.id.iv_icon).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Intent intent = new Intent(mContext, PersonActivity.class);
////                intent.putExtra("id", item.id);
//                mContext.startActivity(intent);
//
//            }
//        });

    }
}
